package com.czk.model.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @Author:ChenZhangKun
 * @Date: 2020/5/11 20:43
 */
public class InformationCollege implements College {
    private List<Department> list=new ArrayList<>();
    public InformationCollege(){
        addDepartment("信息技术","信息技术");
        addDepartment("信息安全","信息安全");
        addDepartment("网络安全","网络安全");
    }
    @Override
    public String getName() {
        return "信息工程学院";
    }

    @Override
    public void addDepartment(String name, String desc) {
        Department department = new Department(name, desc);
        list.add(department);
    }

    @Override
    public Iterator createIterator() {
        return new InformationCollegeIterator(list);
    }
}
